package com.wing.sell.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.sell.model.entity.OrderOffer;
import com.wing.sell.model.response.OrderOfferVO;
import com.wing.sell.model.response.OrderProExcelDetailVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 销售订单产品报价记录表-Dao
 *
 * @author
 */
@Mapper
public interface OrderOfferDao extends BaseMapper<OrderOffer> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<OrderOfferVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<OrderOfferVO> list4app(@Param("page") Page<OrderOfferVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    OrderOfferVO get4appById(Long id);

    /**
     * 获取产品最终价格
     * @param orderId
     * @param id
     * @return
     */
    BigDecimal getOffMoneyBy(@Param("orderId") Long orderId,@Param("proId") Long id);


    BigDecimal getOffMoneyByProductDetailId(@Param("orderId") Long orderId,@Param("proId") Long id);

    /**
     * 导出正式订单
     * @param params 入参
     * @return
     */
    List<OrderProExcelDetailVo> exportInProductInfoDetail(@Param("params") Map<String, Object> params);
}
